

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit TextInfo</title>
        
<script language="JavaScript">  
function fnGetDefaultName(){
    var select = document.getElementById("category.id");
    var index = select.selectedIndex;
    var a = select.options[index].value;

    var tmpName = document.getElementById("name");
	var b = select.options[index].text;
	tmpName.value=b;
//    alert(b);  
}   
</script>  
        	
    </head>
    <body>
        <div class="nav">
<!-- 
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
 -->
            <span class="menuButton"><g:link class="list" action="list">TextInfo List</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">New TextInfo</g:link></span>
        </div>
        <div class="body">
            <h1>Edit TextInfo</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${textInfoInstance}">
            <div class="errors">
                <g:renderErrors bean="${textInfoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${textInfoInstance?.id}" />
                <input type="hidden" name="version" value="${textInfoInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="category">Category:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'category','errors')}">
                                    <g:select optionKey="id" from="${SimpleMenu.list()}" name="category.id" value="${textInfoInstance?.category?.id}"
										onchange="fnGetDefaultName();"
									>
									</g:select>
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:textInfoInstance,field:'name')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="value">Value:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'value','errors')}">
                                    <input type="text" id="value" name="value" value="${fieldValue(bean:textInfoInstance,field:'value')}"/>
                                </td>
                            </tr> 
                        
							<tr class="prop">
                                <td valign="top" class="name">
                                    <label for="display">project:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'basicInfo','errors')}">
                                <g:select optionKey="id" from="${BasicInfo.list()}" name="basicInfo.id" value="${textInfoInstance?.basicInfo?.id}" ></g:select>
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="startDateTime">Start Date Time:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'startDateTime','errors')}">
                                    <input type="text" id="display" name="display" value="${fieldValue(bean:textInfoInstance,field:'startDateTime')}" readonly/>
                                </td>
                            </tr> 
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lastModify">Last Modify:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:textInfoInstance,field:'lastModify','errors')}">
                                    <input type="text" id="display" name="display" value="${fieldValue(bean:textInfoInstance,field:'lastModify')}" readonly/>
                                </td>
                            </tr> 
                                                    
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </div>
            </g:form>
        </div>
        
        <g:render template="/footer" />
            
    </body>
</html>
